package com.ruoyi.production.task;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.production.mapper.WorkOrderInfoMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * @Author:
 * @createTime: 2022年09月06日 10:47:42
 * @Description: 工单任务
 */
@Component("workOrderInfoTask")
public class WorkOrderInfoTask {
    private static final Logger logger = LoggerFactory.getLogger(WorkOrderInfoTask.class);
    @Autowired
    private WorkOrderInfoMapper workOrderInfoMapper;

    public void checkWorkOrder(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long start = Calendar.getInstance().getTimeInMillis();
        logger.info("开始执行工单延期校验任务");
        int i = workOrderInfoMapper.checkUpdateWorkOrder();
        long end = Calendar.getInstance().getTimeInMillis();
        logger.info("结束执行工单延期校验任务,更新数："+ i +",耗时{}",end - start);
    }
}
